package cn.liulin.spring_boot_study.self;

import org.springframework.beans.factory.annotation.Value;

/**
 * cn.liulin.spring_boot_study.self$
 *
 * @author ll
 * @date 2021-10-22 15:26:36
 **/
//@Component
public class DataBaseProperties {
    @Value("${database.driverName}")
    private String driverName;
    @Value("${database.url}")
    private String url;
    private String username;
    private String password;

    public void setDriverName(String driverName) {
        System.out.println(driverName);
        this.driverName = driverName;
    }

    public void setUrl(String url) {
        System.out.println(url);
        this.url = url;
    }

    @Value("${database.username}")
    public void setUsername(String username) {
        System.out.println(username);
        this.username = username;
    }

    @Value("${database.password}")
    public void setPassword(String password) {
        System.out.println(password);
        this.password = password;
    }

    @Override
    public String toString() {
        return "DataBaseProperties{" +
                "driverName='" + driverName + '\'' +
                ", url='" + url + '\'' +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                '}';
    }
}
